{? if $errors|@is_array || $errors|strlen > 0 ?}
	{? assign var=has_error value=true ?}
{? else ?}
	{? assign var=has_error value=false ?}
{? /if ?}

<fieldset id="sign" class="signup">
	<legend>Sign up</legend>
		<form action="../../php/account/do_signup.php" method="post">
			<div class="error" {? if !$has_error ?}style="display:none;"{? /if ?}>
			
			{? if $errors|@is_array ?}
				{? foreach key=key item=item from=$errors ?}
					{? if $key eq "message"?}
						{? if $item|@is_array ?}
						<ul>

							{? foreach key=key item=sub_mes from=$item ?}
							
									<li>
								
									{? $sub_mes ?}
								
									</li>
								{? /foreach ?}

								</ul>

							{? else ?}
								{? $item ?}
							{? /if ?}
						{? else ?}
							{? assign var=$key value=$item ?}
						{? /if ?}
					{? /foreach ?}
				{? else ?}
					{? $errors|escape ?}
				{? /if ?}

			</div>
		<div >
			<div id="username_container" class="row {? if $username eq true ?}error_field{? /if ?}">
				<label for="username" >Username</label>
				<input type="text" name="username" class="text"/>
			</div>
			
			<div id="passwd_container" class="row {? if $passwd eq true ?}error_field{? /if ?}">
				<label for="password">Password</label>
				<input type="password" name="passwd" class="passwd"/>
			</div>

			<div id="re_enter_passwd_container" class="row {? if $re_passwd eq true ?}error_field{? /if ?}">
				<label for="re_enter_password">Re-Enter Password</label>
				<input type="password" name="re_passwd" class="passwd"/>
			</div>

			<div id="email_container" class="row {? if $email eq true ?}error_field{? /if ?}">
				<label for="email">Your E-mail address</label>
				<input type="text" name="email" class="text"/>
			</div>
		</div>
			<div class="row">
				<label for="">
				<a href="#" 
					onclick="Effect.toggle('profile_container','appear'); 
					return false;">Your profile (optional)</a></label>
			</div>

			<div id="profile_container" style="display:none;">
				<div id="nick_container" class="row">
					<label for="nike">Nick</label>
					<input type="text" name="nick" class="text"/>
				</div>

				<div id="sex_container" class="row">
					<label for="sex">Sex</label>
					<input type="text" name="sex" class="text"/>
				</div>
				
				<div id="location_container" class="row">
					<label for="location">Location</label>
					<input type="text" name="location" class="text"/>
				</div>
				
				<div id="motto_container" class="row">
					<label for="motto">Motto</label>
					<input type="text" name="motto" class="text"/>
				</div>
			</div>

			<div class="submit">
				<input type="submit" value="Sign me up!" />
				<input type="reset" value="Reset" />
			</div>
			
		</form>
</fieldset>
<div id="sign_help_info" class="sign_up">
<h3>How to singup soj ?</h3>
<p>
   Please complete and submit this form to signup. if you have any question , 
   contact us in any time.
</p>
</div>
